<?php

namespace App\Transformers;

use App\Models\Phone;
use Spatie\Permission\Models\Role;
use League\Fractal\TransformerAbstract;

class PhoneTransformer extends TransformerAbstract
{

    public function transform(Phone $phone)
    {
        return [
            'id' => $phone->id,
            'phone_number' => $phone->phone_number,
            'user_id' => $phone->user_id,
            'site'=>$phone->setting()->first()->type,
            'created_at' => $phone->created_at->toDateTimeString(),
            'updated_at' => $phone->updated_at->toDateTimeString(),
        ];
    }
}